package com.luomu.base.control.cookBook.excel.controller;

import com.luomu.base.api.cookBook.excel.bo.AddressInfoImportRspBO;
import com.luomu.base.api.cookBook.excel.service.ExpressAddressExcelService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/apis/excelImport")
public class ExcelImportController {
    protected Logger log = LoggerFactory.getLogger(ExcelImportController.class);

    @Autowired
    private ExpressAddressExcelService expressAddressExcelService;


    /**
     * 地址导入
     */
    @PostMapping(value = "/importAddressExcel",consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    AddressInfoImportRspBO importAddressExcel(@RequestPart("file") MultipartFile file, @RequestParam("openId")Long openId, @RequestParam("agentId")String AgentId){
        return expressAddressExcelService.importAddressExcel(file,openId,AgentId);
    }


}
